<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

namespace app\admin\model;

use think\Model;
use think\Db;

/**
 * 后台权限栏目关联
 * @package app\admin\model
 */
class MenuRoleModel extends Model
{
    // 设置当前模型对应的完整数据表名称
    protected $table = 'e_module_role';
	
	/**
     * 获取有效的权限列表
     * @author 郑义生 <1052063941@qq.com>
     * @return mixed
     */
	public function getRoleList($where)
	{
		return Db::name($this->table)->where($where)->where('parent_id','>',0)->select();
	}
	
	/**
     * 获取权限数据
     * @author 郑义生 <1052063941@qq.com>
     * @return mixed
     */
	public function getRole($where)
	{
		return Db::name($this->table)->where($where)->select();
	}
}
